package com.zyc.fuckfx;

import com.zyc.fuckfx.base.BaseCell;
import com.zyc.fuckfx.base.ClipboardUtil;
import com.zyc.fuckfx.base.Log;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.text.Text;

import java.util.ArrayList;

public class InfoCellController extends BaseCell<String> {
    @FXML
    private Label tvName;
    @FXML
    private Text tvValue;

    public InfoCellController() {
        super(FuckApplication.class.getResource("item_info.fxml"));
    }

    @Override
    public void bindData(String item) {
        String[] v = item.split(",");
        tvName.setText(v[0]);
        tvValue.setText(v[1]);
    }

    public void onClickListener() {
        Log.i("点了" + tvName.getText() + "/" + tvValue.getText());
        ClipboardUtil.copy(tvName.getText() + "：" + tvValue.getText());
    }

    @FXML
    private void initialize() {
    }

}
